var mongoose = require('mongoose')

mongoose.connect('mongodb://localhost/hmblog',{ useNewUrlParser: true });

var commentSchema = new mongoose.Schema({
    topic_id:{
        type:String,
        required:true
    },
    for_comment_id:{
        type:String,
        default:''
    },
    content:{
        type:String,
        required:true
    },
    publishTime:{
        type:Date,
        default:Date.now
    },

    from_uid:{
        type:String,
        required:true
    },
    to_uid:{
        type:String,
    },

})

module.exports = mongoose.model('Comment',commentSchema)